/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.system.action.system;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.system.mapper.system.AccountBatchManageMapper;
public class AccountBatchManage extends BaseAction
{
    @Autowired(required=false)
	private AccountBatchManageMapper mapper;
    /**
    账户批量管理
    */
    
    public Map accountBatchManage() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        TreeBean tb;
        
        tb = createTreeBean("s_firm_treecols");
        SQLList<SQLMap> s_firm=mapper.s_firm(params);
        s_firm = s_firm.buildTree(tb,tb.getPid());
        result.put("s_firm", s_firm);
        
        
        SQLList<SQLMap> s_role=mapper.s_role(params);
        result.put("s_role", s_role);
        
        return result;
    }
    /**
    */
    
    public Object s_access() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> s_access=mapper.s_access(params,pagination);
        s_access.setPagedListInfo(pagination);
        result.put("s_access", s_access);
        
        return s_access;
    }
    /**
    */
    
    public Map down_outline() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> l_access=mapper.l_access(params);
        result.put("l_access", l_access);
        
        
        SQLList<SQLMap> s_title =buildExcelTitle(AccountBatchManage.class,"s_title");
        
        
        TreeTableHelper.exportList(l_access,s_title,context,"登录账户.xls");
        
        return null;
    }
    /**
    导入账户修改
    */
    
    public Map importAccountSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        TreeTableHelper.buildRequirementElementsMap(context,false);
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.b_person(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("")){
            params=new SQLParam(request,emt.getMap());
            mapper.b_account(params);
        }
        
        return result;
    }
    public Map ajaxList(){
        String sql="";
        String pagesql="";
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        if(request.getParameter("cfield_name").contains("CMIDSEL8")){
            SQLList<SQLMap> CMIDSEL8=mapper.CMIDSEL8(params);
            result.put("CMIDSEL8", CMIDSEL8);
        }
        
        return result;
    }
}